package com.hulk.rpc.transport.server.rest.protocol;

import com.hulk.rpc.invoke.Invoker;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpResponseStatus;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.concurrent.CompletableFuture;

/**
 * @author xuxukang
 */
@Data
@Accessors(chain = true)
public class RestHttpResponse {

  private Invoker<CompletableFuture<?>> invoker;
  private FullHttpRequest request;
  private HttpResponseStatus status;
  private Object result;
  private boolean keepAlive;

  public RestHttpResponse() {
  }

  public RestHttpResponse(Invoker<CompletableFuture<?>> invoker, FullHttpRequest request, HttpResponseStatus status,
                          Object result, boolean keepAlive) {
    this.invoker = invoker;
    this.request = request;
    this.status = status;
    this.result = result;
    this.keepAlive = keepAlive;
  }

}
